home *** CD-ROM | disk | FTP | other *** search
/ MacPeople 2003 February 1 / MACPEOPLE-2003-02-01.ISO.7z / MACPEOPLE-2003-02-01.ISO / ぶらりオンラインウェアの旅 / おしゃべり漂流記 / xGates / xGates 1.2 Source Code.sit / xGates 1.2 Source Code / sound.c < prev    next >
Text File  |  2002-11-24  |  2KB  |  83 lines

  1. /*
  2.     xGates -- Stunningly entertaining action game for MacOS Classic / MacOS X
  3.     Copyright (C) 2002 Sveinbjorn Thordarson <paladeen@soth.zoneit.com>
  4.  
  5.     This program is free software; you can redistribute it and/or modify
  6.     it under the terms of the GNU General Public License as published by
  7.     the Free Software Foundation; either version 2 of the License, or
  8.     (at your option) any later version.
  9.  
  10.     This program is distributed in the hope that it will be useful,
  11.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.     GNU General Public License for more details.
  14.  
  15.     You should have received a copy of the GNU General Public License
  16.     along with this program; if not, write to the Free Software
  17.     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18.  
  19.     sound.c
  20.  
  21. */
  22.  
  23. #include "externs.h"
  24. #include "prototypes.h"
  25. #include "definitions.h"
  26.  
  27.  
  28.  
  29. //////////////////////////////////////////////////////
  30. //Silence sound channel
  31. //////////////////////////////////////////////////////
  32.  
  33. void SilenceChannel(SndChannelPtr theChannel)
  34. {
  35.     SndCommand theCmd;
  36.     
  37.     theCmd.param1 = 0;
  38.     theCmd.param2 = 0;
  39.     theCmd.cmd = quietCmd;
  40.     SndDoImmediate(theChannel, &theCmd);
  41.     theCmd.cmd = flushCmd; 
  42.     SndDoImmediate(theChannel, &theCmd);
  43. }
  44.  
  45.  
  46. //////////////////////////////////////////////////////
  47. //Silence them all!
  48. //////////////////////////////////////////////////////
  49.  
  50. void SilenceAllChannels (void)
  51. {
  52.     SilenceChannel(weaponSndChannel);
  53.     SilenceChannel(billSndChannel);
  54.     SilenceChannel(steveSndChannel);
  55.     SilenceChannel(computerSndChannel);
  56.     SilenceChannel(musicSndChannel);
  57.     SilenceChannel(dojSndChannel);
  58.     SilenceChannel(otherSndChannel);
  59.     
  60. }
  61.  
  62.  
  63.  
  64. //////////////////////////////////////////////////////
  65. //Check if looped music is finished.  If not, nothing,
  66. //otherwise, it's ,,Play it again, Sam"
  67. //////////////////////////////////////////////////////
  68. void ServiceMusic(void)
  69. {
  70.     SCStatus musicChannelStatus;
  71.     
  72.     if(prefs.music == true)
  73.     {
  74.         SndChannelStatus(musicSndChannel, sizeof(SCStatus), &musicChannelStatus);
  75.         
  76.         if(!musicChannelStatus.scChannelBusy)
  77.         {
  78.             SndPlay(musicSndChannel, (SndListHandle)musicSounds[levels[currentLevel].musicNum], true);
  79.         }
  80.     }
  81. }
  82.  
  83.